﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PPI.Entities;

namespace PPI.Controls
{
    public partial class PositionInspection : Position
    {
        public PositionInspection()
        {
            InitializeComponent();

            HideControls();
        }

        private void HideControls()
        {
            this.lblAltitude.Visible = false;
            this.txtAltitude.Visible = false;
            this.lblSatelliteCount.Visible = false;
            this.txtSatelliteCount.Visible = false;
            this.lblSatelliteTime.Visible = false;
            this.dateSatelliteTime.Visible = false;
        }

        public override void CleanPositions()
        {
            txtLatitude.Clear();
            txtLongitude.Clear();
        }

        public override bool ValidatePosition()
        {
            bool _Validate = true;
            if(GetLatitude() == double.MinValue)
                _Validate = false;
            if (GetLongitude() == double.MinValue)
                _Validate = false;
            lblError.Visible = !_Validate;
            return _Validate;
            
        }

        public override void GetPosition(EBasePosition position)
        {
            position.Latitude = GetLatitude();
            position.Longitude = GetLongitude();
        }
    }
}
